﻿@{
    ViewBag.Title = "修改密码";
}
@section Styles{
    <link href="~/Content/zk/css/public.css" rel="stylesheet" />
<link href="~/Content/zk/css/space.css" rel="stylesheet" />
<link href="~/Content/zk/css/about.css" rel="stylesheet" />
}
@section Scripts{

<script src="http://apps.bdimg.com/libs/layer.m/1.5/layer.m.js"></script>
<script type="text/javascript">
  
    $(function () {

        $("#btnSend").click(function () {


            var password = $("#password").val();
            if (password == '') {
                $('#password').focus();
                layer.open({
                    content: '请填写原密码',
                    style: 'background:rgba(0,0,0, .6); color:#fff; border:none;',
                    time: 2,
                    shade: false
                });
                return false;
            }
            var password1 = $('#password1').val();
            if (password1 == '') {
                $('#password1').focus();
                layer.open({
                    content: '请输入新密码',
                    style: 'background:rgba(0,0,0, .6); color:#fff; border:none;',
                    time: 2,
                    shade: false
                });
                return false;
            }


            var reg = /^\w{4,10}$/;
            var flag = reg.test(password1);
            if (flag == false) {

                $('#password1').focus();
                layer.open({
                    content: '新密码必须由 4-10位字母、数字、组成.',
                    style: 'background:rgba(0,0,0, .6); color:#fff; border:none;',
                    time: 2,
                    shade: false
                });
                return false;
            }

            var password2 = $('#password2').val();
            if (password2 != password1) {
                $('#password2').focus();
                layer.open({
                    content: '二次密码不一样！',
                    style: 'background:rgba(0,0,0, .6); color:#fff; border:none;',
                    time: 2,
                    shade: false
                });
                return false;
            }


            var data = $('form').serializeArray();
            $.post(
                '/u/UpdatePwd.html',
                data,
                function (res) {

                    layer.open({
                        content: res.Message,
                        style: 'background:rgba(0,0,0, .6); color:#fff; border:none;',
                        time: 2,
                        shade: false
                    });
                    if (res.State == true)
                        setTimeout(" location.reload()", 2000);
                },
                'json'
            );
        })
    })
</script>

}
 
        <ul class="tabMenu clearfix">
            <li><a href="/u/Info.html" data-type="1"><span>个人资料</span></a></li>
            <li class="cur"><a href="/u/Pwd.html" data-type="2"><span>修改密码</span></a></li>
        </ul>
        <form name="form1" method="post" >
            <ul class="masterList">
                <li>
                    <p class="clearfix">
                        <span class="fl">原密码：</span> <input type="password"  name="password" id="password" class="alipay-focus fl" placeholder="请输入原密码">
                    </p>
                </li>
                <li>
                    <p class="clearfix">
                        <span class="fl">新密码：</span>
                        <input class="alipay-focus fl" type="password" name="password1" id="password1" placeholder="新密码">
                    </p>
                </li>
                <li>
                    <p class="clearfix">
                        <span class="fl">确认密码：</span>
                        <input class="alipay-focus fl" type="password" name="password2" id="password2" placeholder="确认密码">
                    </p>
                </li>
            </ul>
            <div ng-app="commentApp" ng-controller="commentCtrl" class="messageBox">

                <p class="iline "><a id="btnSend" class="btn blue" href="javascript:void(0)">提交</a></p>

            </div>
        </form>
 

 